<template>
	<view class="container">
		<view class="qrcode_main">
			<view class="title">
				<image src="../../static/icon/erweima.png"></image>
				<text>客户{{customerNumber}}的收款码</text>
			</view>				
		</view>
		<view class="qrcode_main">
			<image :src="qrcode" class="qrcode-img"></image>
		</view>
	</view>
	
</template>

<script>
	import QR from '../../common/wxqrcode.js'
	
	export default {
		data() {
			return {
				customerNumber:'',
				qrcode:''
			}
		},
		methods: {
			
		},
		onLoad() {
			//读取出客户编号
			this.customerNumber = uni.getStorageSync('customerNumber')
			
			//生成二维码 
			let qrcodeData = {
				targetCustomerNumber:this.customerNumber
			}	
					
			let qrcodeDataStr = JSON.stringify(qrcodeData)
			
			this.qrcode = QR.createQrCodeImg(qrcodeDataStr)
		}
	}
</script>

<style>
	page {
		background: #EDEDED;
	}
	
	.container {
		padding: 15rpx;
	}
	
	.qrcode_main {
		padding: 30rpx;
		font-size: 30rpx;		
		background-color: #FFFFFF;
		border-radius: 25rpx;
		margin-bottom: 30rpx;
	}
	
	.qrcode_main .title {
		color: #333333;
		font-weight: bold;
		height: 80rpx;
		line-height: 80rpx;		
		text-align: center;
	}
	
	.qrcode_main .title image {
		width: 80rpx;
		height: 80rpx;
		float: left;
	}
	
	.qrcode-img {
		width: 660rpx;
		height: 660rpx;
	}
</style>